#include <QApplication>
#include <QQmlApplicationEngine>
#include <QQuickWidget>
#include <QtQuick/QQuickView>
#include <QtQml/QQmlContext>
#include <QtWebView>
#include <QHBoxLayout>
#include "Widget.h"
#include <QGuiApplication>
#include <QQmlApplicationEngine>

int main(int argc, char *argv[])
{
#if 1
    QtWebView::initialize();
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
    QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif

    QApplication a(argc, argv);
    Widget w;

    w.show();

    return a.exec();
#else

    QGuiApplication app(argc, argv);

    QQmlApplicationEngine engine;
    const QUrl url(u"qrc:/qml_test02/Main.qml"_qs);
    QObject::connect(&engine, &QQmlApplicationEngine::objectCreationFailed,
        &app, []() { QCoreApplication::exit(-1); },
        Qt::QueuedConnection);
    engine.load(url);

    return app.exec();
#endif
}
